# -*- coding: utf-8 -*-
#  @author  Bink
#  @date  2020/8/29 18:05
# @Email : 2641032316@qq.com


# TODO
#  定义动物类
class Animal:
    def eat(self):
        print('Animal eat...')


#  定义子类：鱼类，饮食行为：在水中吃虫和草
class Fish(Animal):
    def eat(self):
        print(f'{self.__class__.__name__}在水中吃虫和草...')


#  定义子类：狗类，饮食行为：啃骨头吃杂食
class Dog(Animal):
    def eat(self):
        print(f'{self.__class__.__name__}啃骨头吃杂食...')


#  定义饲养员类，利用多态，输出饲养员饲养的动物的饮食行为是什么？
class Zookeeper:
    def __init__(self, animal: Animal):
        self.animal = animal

    @classmethod
    def animalsEat(cls, *animals: Animal):
        for animal in animals:
            animal.eat()

    def animalEat(self):
        if self.animal is not None:
            self.animal.eat()


if __name__ == "__main__":
    Zookeeper.animalsEat(Animal(), Fish(), Dog())
    print('*'*99)
    Zookeeper(Animal()).animalEat()
    Zookeeper(Fish()).animalEat()
    Zookeeper(Dog()).animalEat()